package i2.application.fmw.codes;

import i2.application.fmw.dao.DAO;

import java.util.ArrayList;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CodeList<E> extends ArrayList<E> {

	private static final long serialVersionUID = 1L;
	private static final Logger logger = LoggerFactory.getLogger(CodeList.class);
	
	private DAO<E> dao;

	public void init() {
		logger.debug("call init");
		addAll(dao.findAll());
	}

	public void setDao(DAO<E> dao) {
		logger.debug("call setDao");
		this.dao = dao;
	}
	
	public void reset() {
		logger.debug("call reset");
		clear();
		init();
	}
	
}
